<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: function.outerContainer.php 417 2014-01-18 16:25:05Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 417 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2014-01-18 16:25:05 +0000 (Sat, 18 Jan 2014) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */
function smarty_function_outerContainer($V4e2242f2=array(), &$V17b168dc) {
  global $db;
	$container_ids = '';
  $V811882fe='';$V7c4f2940='';$Vb28354b5='';$V71f262d7='';	$boxview=true;
  if( BOXLESS_CHECKOUT=='true' && strstr($_SERVER['PHP_SELF'], FILENAME_SHOPPING_CART))
  	$boxview=false;
  	
  if($boxview && PRODUCT_ID > 0) {
  	$query=$db->db_query("
  		SELECT products_col_top,products_col_left,products_col_right,products_col_bottom 
  		FROM ".TABLE_PRODUCTS." 
  		WHERE products_id='".intval(PRODUCT_ID)."'",true);
  	if($query->fields['products_col_left']=='1')		$container_ids .= '_left';
  	if($query->fields['products_col_right']=='1')		$container_ids .= '_right';
  	if($query->fields['products_col_top']=='1')			$container_ids .= '_top';
  	if($query->fields['products_col_bottom']=='1')	$container_ids .= '_bottom';
  	return'<div id="outerContainer'.$container_ids.'" class="outer_container">';
  }
  
  else if($boxview && CONTENT_ID>0) {
  	$query=$db->db_query("
  		SELECT content_col_top,content_col_left,content_col_right,content_col_bottom 
  		FROM ".TABLE_CONTENT_MANAGER." 
  		WHERE content_group='".intval(CONTENT_ID)."'",true);
  		
		if($query->fields['content_col_left']=='1')		$container_ids .= '_left';
		if($query->fields['content_col_right']=='1')	$container_ids .= '_right';
		if($query->fields['content_col_top']=='1')		$container_ids .= '_top';
		if($query->fields['content_col_bottom']=='1')	$container_ids .= '_bottom';
  	
  	return '<div id="outerContainer'.$container_ids.'" class="outer_container">';
  }
  
  else if($boxview && CAT_ID>0) {
  	$catArr=explode('_',CAT_ID);
  	$query=$db->db_query("
  		SELECT categories_col_top,categories_col_left,categories_col_right,categories_col_bottom 
  		FROM ".TABLE_CATEGORIES." 
  		WHERE categories_id='".intval(end($catArr))."'",true);
  	if($query->fields['categories_col_left']=='1')		$container_ids .= '_left';
  	if($query->fields['categories_col_right']=='1')		$container_ids .= '_right';
  	if($query->fields['categories_col_top']=='1')			$container_ids .= '_top';
  	if($query->fields['categories_col_bottom']=='1')	$container_ids .= '_bottom';
  	return '<div id="outerContainer'.$container_ids.'" class="outer_container">';
  }
  
  else 
  if(!((
  		strstr($_SERVER['PHP_SELF'],FILENAME_SHOPPING_CART)
  		|| strstr($_SERVER['PHP_SELF'],FILENAME_CHECKOUT_SHIPPING)
  		|| strstr($_SERVER['PHP_SELF'],FILENAME_CHECKOUT) 
  		|| strstr($_SERVER['REQUEST_URI'],FILENAME_CHECKOUT)
  		|| strstr($_SERVER['PHP_SELF'],FILENAME_CHECKOUT_CONFIRMATION)
  		|| strstr($_SERVER['PHP_SELF'],FILENAME_CHECKOUT_PAYMENT) 
  		|| strstr($_SERVER['PHP_SELF'],FILENAME_CHECKOUT_PAYMENT_ADDRESS)
  		|| strstr($_SERVER['PHP_SELF'],FILENAME_CHECKOUT_SHIPPING_ADDRESS)
  		|| strstr($_SERVER['PHP_SELF'],FILENAME_CHECKOUT_PAYMENT_ADDRESS)
  		|| strstr($_SERVER['PHP_SELF'],FILENAME_CHECKOUT_SUCCESS)
  	)
  	&& isset($_SESSION['customer_id'])
  	&& BOXLESS_CHECKOUT=='true'
  	&&BLOG_STAND_ALONE=='true')){
  	
  	if(GLOBAL_COLUMN_LEFT==1)		$container_ids .= '_left';
  	if(GLOBAL_COLUMN_RIGHT==1)	$container_ids .= '_right';
  	if(GLOBAL_COLUMN_TOP==1)		$container_ids .= '_top';
  	if(GLOBAL_COLUMN_BOTTOM==1)	$container_ids .= '_bottom';
  	return '<div id="outerContainer'.$container_ids.'" class="outer_container">';
  }
  
  elseif(
  	BLOG_STAND_ALONE=='true'
  	&& (BLOG_CAT>0||BLOG_ITEM>0||IS_BLOG=='true')){
  	return '<div id="outerContainer_left_top_bottom" class="outer_container">';
  }
  
  else 
  	return '<div id="outerContainer_top_bottom" class="outer_container">';
}